package net.xdclass.demoproject.aop;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class XmlAopTest {


    public static void main(String[] args){
        // 获取xml配置文件
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext
                ("classpath*:aop.xml");
        // 获取被代理对象
        CurdService curdService = (CurdService)context.getBean("curdService");
        // 获取project实体类
        CoderProject project = (CoderProject) context.getBean("project");
        // 获取增强类
//        CheckExist ce = (CheckExist)curdService;
        if(true){
            curdService.insert();
            System.out.println("----------");
            curdService.add();
        }
        else{
            System.out.println("project不能为空");
        }
    }

}
